using System;
using System.Configuration;

namespace AntEater.ComponentModel.Configuration
{
    /// <summary>
    /// Provides the configuration information for a named configuration element.
    /// </summary>
    public abstract class NamedElement : ConfigurationElement
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="T:NamedElement"/> class.
        /// </summary>
        protected NamedElement() {
        }

        /// <summary>
        /// Gets the name.
        /// </summary>
        /// <value>The name.</value>
        [ConfigurationProperty("name", IsRequired = true, IsKey = true)]
        public string Name {
            get { return (string)this["name"]; }
        }

    }
}
